<template>
  <div id="app">
    <div id="nav" class="nav">
      <router-link to="/">Home</router-link>
      <router-link to="/about">About</router-link>
      <router-link to="/login">About</router-link>
      <!-- <div @click="toUrl(1)">Home</div>
      <div @click="toUrl(2)">About</div> -->
    </div>
    <router-view />
  </div>
</template>

<script>
export default {
  methods: {
    toUrl(type) {
      if (type === 1) {
        this.$router.push({
          path: "/"
        })
      } else if (type === 2) {
        this.$router.push({
          path: "/about/123"
        })
      }
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
  display: flex;
  justify-content: center;
}

#nav div{
  margin: 0 20px;
  color: blue;
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}
#nav a {
  margin: 0 20px;
  color: blue;
  font-size: 16px;
}
</style>
